import { http } from '@/utils/http/axios';

/**
 * @description: 根据用户id获取用户菜单
 */
export function adminMenus() {
  return http.request({
    url: '/sys/menu/userMenu',
    method: 'GET',
  });
}

/**
 * 获取tree菜单列表
 * @param params
 */
export function getMenuList(params?) {
  return http.request({
    url: '/sys/menu/tree',
    method: 'GET',
    params,
  });
}
export function getMenuInfo(params?) {
  return http.request({
    url: '/sys/menu/info',
    method: 'GET',
    params,
  });
}
/**
 * 保存菜单
 * @data data
 */
export function saveMenu(data?) {
  return http.request({
    url: '/sys/menu',
    method: 'PUT',
    data,
  });
}
/**
 * 保存菜单
 * @data data
 */
export function createMenu(data?) {
  return http.request({
    url: '/sys/menu',
    method: 'POST',
    data,
  });
}
/**
 * 保存菜单
 * @data data
 */
export function deleteMenu(params?) {
  return http.request({
    url: '/sys/menu',
    method: 'DELETE',
    params,
  });
}
